/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package marsaMaroc.controllers;

import marsaMaroc.dao.AdminDAO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 *
 * @author Administrateur
 */
@Controller
public class AdminController {
    
    AdminDAO adminDAO = new AdminDAO();
    
    @RequestMapping(value = "/admin.htm", method = RequestMethod.GET)
    protected ModelAndView add() throws Exception {
      
        return new ModelAndView("admin_side/admin_index").addObject("nb_clients", adminDAO.getClientCount()).addObject("nb_factures", adminDAO.getFactureCount()).addObject("nb_reclamations", adminDAO.getReclamationCount());
    }
    
}
